home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / Storage / Bento / BentoSuppress.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  1.8 KB  |  76 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        BentoSuppress.cpp
  3.  
  4.     Contains:    classes to temporarily suppress or delay fatal Bento errors.
  5.  
  6.     Owned by:    Douglas Hill
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>     8/19/96    DH        1376276:OD corrupts document when out of
  13.                                     disk creating draft. Introduced TempCMValue
  14.                                     class to properly set and reset usecount of
  15.                                     values.
  16.          <2>     8/13/96    DM        1376080: new class TempDelayBentoFatalError
  17.                                     prevents fatal errors from being
  18.                                     permanently disabled
  19. */
  20.  
  21. #ifndef _BENTOSUPPRESS_
  22. #include "BentoSuppress.h"
  23. #endif
  24.  
  25. //------------------------------------------------------------------------------
  26. // TempSuppressFatalBentoError
  27. //------------------------------------------------------------------------------
  28.  
  29. TempSuppressFatalBentoError::TempSuppressFatalBentoError()
  30. {
  31.     fOldSuppress = gODSuppressBentoFatalError;
  32.     gODSuppressBentoFatalError = kODTrue;
  33. }
  34.  
  35. TempSuppressFatalBentoError::~TempSuppressFatalBentoError()
  36. {
  37.     gODSuppressBentoFatalError = fOldSuppress;
  38. }
  39.     
  40.  
  41. //------------------------------------------------------------------------------
  42. // TempDelayBentoFatalError
  43. //------------------------------------------------------------------------------
  44.  
  45. TempDelayBentoFatalError::TempDelayBentoFatalError()
  46. {
  47.     fOldDelay = gODDelayBentoFatalError;
  48.     gODDelayBentoFatalError = kODTrue;
  49. }
  50.  
  51. TempDelayBentoFatalError::~TempDelayBentoFatalError()
  52. {
  53.     gODDelayBentoFatalError = fOldDelay;
  54. }
  55.     
  56.  
  57. //------------------------------------------------------------------------------
  58. // TempCMValue
  59. //------------------------------------------------------------------------------
  60.  
  61. TempCMValue::TempCMValue()
  62.     : fValue( kODNULL )
  63. {
  64. }
  65.  
  66. TempCMValue::~TempCMValue()
  67. {
  68.     if ( fValue )
  69.     {
  70.         CMValue v = fValue;
  71.         fValue = kODNULL;
  72.         CMReleaseValue(v);
  73.     }
  74. }
  75.     
  76.